/*
  MapReduce Common Library
  by DongWoo Lee
*/

var mrSource = [ ];
var mStore = new Array();
var rStore = new Array();

function mr_init() 
{
	print("starting MR...");
}

function mr_close()
{
	print("stopping MR...");
	delete(mStore);
	delete(rStore);
}

function emit(key, value)
{
	if(typeof(mStore[key]) == 'undefined')
	{
		mStore[key] = [ value ]
	} else
	{
		mStore[key].push(value);
	}
}

function showStore(o)
{
	for(var i in o) {
		print("key: "+i+" -- "+o[i]);
	}
}
